﻿
namespace WindowsAPI.Windows
{
    public partial class WindowVisualInfoControl : WindowViewerControl
    {
        public WindowVisualInfoControl() { InitializeComponent(); }

        public override void Clear()
        {
            base.Clear();

            f_X_TextBox.Clear();
            f_Y_TextBox.Clear();
            f_Width_TextBox.Clear();
            f_Height_TextBox.Clear();
            f_ChildsCount_TextBox.Clear();
        }

        public override void View(Window w)
        {
            base.View(w);
            if(w == null) return;

            var rect = w.Rectangle;

            f_X_TextBox.Text = rect.Left.ToString();
            f_Y_TextBox.Text = rect.Top.ToString();
            f_Width_TextBox.Text = rect.Width.ToString();
            f_Height_TextBox.Text = rect.Height.ToString();
            f_ChildsCount_TextBox.Text = w.Childs.Length.ToString();
        }
    }
}
